package paidaxing.blog.common.constant;

/**
 * 文章常量类
 *
 * @author heefM
 * @date 2025-10-17
 */
public class PostConstant {

    /**
     * 文章状态
     */
    public static final String POST_STATUS_DRAFT = "DRAFT";
    public static final String POST_STATUS_PUBLISHED = "PUBLISHED";
    public static final String POST_STATUS_PRIVATE = "PRIVATE";
    public static final String POST_STATUS_TRASH = "TRASH";

    /**
     * 文章类型
     */
    public static final String POST_TYPE_POST = "POST";
    public static final String POST_TYPE_PAGE = "PAGE";

    /**
     * 评论状态
     */
    public static final String COMMENT_STATUS_PUBLISHED = "PUBLISHED";
    public static final String COMMENT_STATUS_PENDING = "PENDING";
    public static final String COMMENT_STATUS_SPAM = "SPAM";
    public static final String COMMENT_STATUS_TRASH = "TRASH";

    /**
     * 评论类型
     */
    public static final String COMMENT_TYPE_POST = "POST";
    public static final String COMMENT_TYPE_PAGE = "PAGE";

    /**
     * 文章相关限制
     */
    public static final int TITLE_MIN_LENGTH = 2;
    public static final int TITLE_MAX_LENGTH = 200;
    public static final int CONTENT_MIN_LENGTH = 10;
    public static final int EXCERPT_MAX_LENGTH = 500;

    /**
     * 分页相关
     */
    public static final int DEFAULT_PAGE_SIZE = 10;
    public static final int MAX_PAGE_SIZE = 100;

    /**
     * 排序字段
     */
    public static final String SORT_CREATE_TIME = "created_at";
    public static final String SORT_UPDATE_TIME = "updated_at";
    public static final String SORT_PUBLISH_TIME = "published_at";
    public static final String SORT_VIEW_COUNT = "view_count";
    public static final String SORT_LIKE_COUNT = "like_count";

    /**
     * 缓存key
     */
    public static final String CACHE_POST_KEY = "post:";
    public static final String CACHE_POST_VIEW_KEY = "post_view:";
    public static final long CACHE_POST_TTL = 60 * 60L; // 1小时
}
